package iface

import (
	"fmt"
)

type Person struct {
	Name	string
}

type PoliceMan struct {
	Person
}

type Sayable interface {
	Say()
}

func NewPerson() *Person {
	return &Person{

	}
}

func NewPoliceMan(name string) *PoliceMan {
	return &PoliceMan{Person{Name: name}}
}


func (policeMan *PoliceMan) Say() {
	fmt.Println("Officer ", policeMan.Name, " said: stop running or i will shot you")
}

type Animal struct {
	Name 	string
	Type 	string
}

func NewAnimal(t, name string) *Animal {
	return &Animal{
		Type: t,
		Name: name,
	}
}

func (animal *Animal) Say() {
	switch animal.Type {
	case "dog":
		fmt.Println(animal.Type, " says wof wof")
	case "cat":
		fmt.Println(animal.Type, " says meow, meow")
	}
}

